﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using WpfDataBingding;
using WpfDataBingding.MonitorPage;

namespace WpfDataBingding.FramePanel
{
    /// <summary>
    /// LeftMenu.xaml 的交互逻辑
    /// </summary>
    public partial class DirectMenu : UserControl
    {
        private Frame mainframe;

        public DirectMenu()
        {
            InitializeComponent();
            mainframe = null;
            
        }

        public Frame MainFrame
        {
            get { return mainframe; }
            set { mainframe = value; }
        }

        private void ButtonMenu_Click(object sender, RoutedEventArgs e)
        {
            if (mainframe == null)
            {
                MessageBox.Show("用户页面不存在！");
                return;
            }

            Button direct = e.Source as Button;
            string para = direct.CommandParameter.ToString();

            MessageBox.Show("hello Leon");

            MonitorDeviceSimple device = new MonitorDeviceSimple();
            mainframe.Navigate(device);
           
        }

        private void Shut_Menu_Click(object sender, RoutedEventArgs e)
        {
            
        }
        
        
    }
}
